<form id="form-cart"><table class="table_cart">
        <tbody><tr>
                <th class="san_pham">Sản phẩm</th>
                <th class="mo_ta">Mô tả</th>
                <th class="so_luong">Số lượng</th>
                <th class="don_gia">Đơn giá</th>
                <th class="thanh_tien">Thành tiền</th>
                <th class="xoa">Xóa</th>
            </tr>
            {{assign var='tongtien' value=0}}
            {{if isset($cart)}}
            {{foreach $cart as $item}}{{$tongtien=$tongtien+$item['subtotal']}}
            {{$itemInfo = $news_model->get_details('',$item['name'])}}
            <tr>
                <td><img src="{{$itemInfo->image|base_url}}"></td>
                <td>
                    <p>{{$itemInfo->title}}</p>
                    <p><span>{{$itemInfo->description}}</span></p>
                </td>
                <td>
                    <!--<input class="amount {{$item['id']}}" name="qty[]" type="text" value="{{$item['qty']}}"/>
                    <input type="button" value="Cập nhật" onclick="update_qty();"/>-->
                    <select class="amount" name="qty[]" onchange="update_qty();">
                        {{for $i=1 to 20}}
                        <option {{if $i==$item['qty']}}selected{{/if}} value="{{$i}}">{{$i}}</option>
                        {{/for}}
                    </select>
                    <input type="hidden" name="rowid[]" value="{{$item['rowid']}}" />
                </td>
                <td>{{$item['price']|vnd_format:' VNĐ'}}</td>
                <td>{{$item['subtotal']|vnd_format:' VNĐ'}}</td>
                <td><a href="javascript:;" title="Xóa sản phẩm này" onclick="deleteItem('{{$item['rowid']}}');">X</a></td>
            </tr>
            {{/foreach}}
            {{/if}}
            
        </tbody></table></form>
    <div class="sum">TỔNG SỐ TIỀN:&nbsp; <span>{{$tongtien|vnd_format:' VNĐ'}}</span></div>
    <script>
        $(document).ready(function(){
            $("div.amount").html('<span>{{$countCart}}</span>');
        })  
    </script>